<include file="Public/mobile_head"/>	
<link href="{:ADDON_PUBLIC_PATH}/card.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
<body>
	<div id="container" class="container body">
    	<div class="p_10 top_line"> 
        	<h5 class="page_title"></h5>
            <!-- 表单 -->
            <form method="post" class="m_15">
              <!-- 基础文档模型 -->
              
              <div id="tab1" class="tab-pane">
              	<div class="block_content_bg">
                  <div class="block_content_top">
                  		<h6><img width="40px" src="{:ADDON_PUBLIC_PATH}/vip_head.png" /> 填写会员卡资料</h6>
                  </div>
                  <div class="p_10">
                      <div class="form-item cf">
                            <label class="item-label">姓名:</label>
                            <div class="controls">
                              <input type="text" maxlength="30" placeholder="请输入姓名" class="text input-medium" name="cli_name" id="cli_name" value="{$info.cli_name}">
                              <b class="must">*</b>
                            </div>
                       </div>
                       <div class="form-item cf">
                            <label class="item-label">手机号:</label>
                            <div class="controls">
                              <input type="tel" maxlength="30" placeholder="请输入手机号码" class="text input-large" name="cli_tel" id="cli_tel" value="{$info.cli_tel}">
                              <b class="must">*</b>
                            </div>
                       </div>
                      <div class="form-item cf">
                          <label class="item-label">所属区域:</label>
                          <div class="controls">
                              <select name="com_area_code" id="arealist">
                                  <option value="0">--请选择--</option>
                                  <foreach name="flist" item="opt">
                                      <option value="{$opt.code}" <eq name="info.com_area_code" value="$opt.code"> selected</eq>>{$opt.name}</option>
                                  </foreach>
                              </select>
                          </div>
                      </div>
                      <div class="form-item cf">
                          <label class="item-label">所属门店:</label>
                          <div class="controls">
                              <select name="com_md_code" id="mdlist">
                                  <option value="0">--请选择--</option>
                                  <foreach name="mlist" item="opt">
                                      <option value="{$opt.code}" <eq name="info.com_md_code" value="$opt.code"> selected</eq>>{$opt.name}</option>
                                  </foreach>
                              </select>
                          </div>
                      </div>
                      <div class="form-item cf">
                          <label class="item-label">生日:</label>
                          <div class="controls">
                              <input type="date" placeholder="请输入出生年月" class="text input-large" name="cli_birthday" value="{$info.cli_birthday}">
                          </div>
                      </div>
                      <div class="form-item cf">
                          <label class="item-label">地址:</label>
                          <div class="controls">
                              <input type="text" maxlength="30" placeholder="请输入地址" class="text input-large" name="cli_add" value="{$info.cli_add}">
                          </div>
                      </div>
                      <div class="form-item cf">
                          <label class="item-label">身份证号:</label>
                          <div class="controls">
                              <input type="number" maxlength="30" placeholder="请输入身份证" class="text input-large" name="cli_id" value="{$info.cli_id}">
                          </div>
                      </div>
                    </div>
                 </div>          
                 <div class="form-item pt_10">
                	<button class="home_btn submit-btn mb_10 flex_1" id="submit" type="submit" target-form="form-horizontal">提  交</button>
                 </div>
                 <!--<div class="form-item pt_10">-->
                	<!--<a class="btn yellow_btn mb_10 flex_1" href="{:addons_url($_REQUEST ['_addons'].'://'.$_REQUEST ['_controller'].'/bindCard')}" target="_blank">绑定已有实体卡</a>-->
                 <!--</div>-->
          	</div>
            </form>
        </div>
        <p class="copyright">{$system_copy_right}</p>
    </div>
    <script type="text/javascript">
		$('#submit').click(function(){
			//$.Dialog.loading();//loading等待调用  loading完成$.Dialog.close();关闭loading
			//$.Dialog.success();//成功调用 提示一秒后自动关闭
			if($('#username').val()!=undefined && $('#username').val()==""){
				$.Dialog.fail("请填写姓名！");//成功调用 提示一秒后自动关闭
				return false;
			}
			if($('#phone').val()!=undefined && $('#phone').val()==""){
				$.Dialog.fail("请填写手机号！");//成功调用 提示一秒后自动关闭
				return false;
			}
		});
        $('#arealist').change(function(){
            var areacode = $(this).val();
            $('#mdlist').html('<option value="0">--请选择--</option>');
            if(areacode!=0){
                $.Dialog.loading();
                $.ajax({
                    url:"{:U('getmdList')}&areacode="+areacode,
                    type:"get",
                    dataType:"json",
                    success:function(data){
                        $.Dialog.close();
                        $('#mdlist').html('<option value="0">--请选择--</option>');
                        if(data){
                            $.each(data, function(index, row){
                                var option = $('<option value="' + row.code + '">' + row.name + '</option>');
                                $('#mdlist').append(option);
                            })
                        }
                    }
                });
            }
        })
		
    </script>
</body>
</html>
